<html>
<head><meta charset="utf-8"><title>set builtin attr values at command line? · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/set.20builtin.20attr.20values.20at.20command.20line.3F.html">set builtin attr values at command line?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="235369384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/set%20builtin%20attr%20values%20at%20command%20line%3F/near/235369384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/set.20builtin.20attr.20values.20at.20command.20line.3F.html#235369384">(Apr 20 2021 at 16:02)</a>:</h4>
<p>Hey, is there a standard way we have for setting the value of one of the crate-wide <code>BuiltinAttributes</code> via the <code>rustc</code> command line? Or does one currently have to add a command-line option for any such attribute that one might want to set? (Or even override, I'm supposing.)</p>



<a name="235369602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/set%20builtin%20attr%20values%20at%20command%20line%3F/near/235369602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/set.20builtin.20attr.20values.20at.20command.20line.3F.html#235369602">(Apr 20 2021 at 16:03)</a>:</h4>
<p>there's a way to inject attributes I think</p>



<a name="235369633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/set%20builtin%20attr%20values%20at%20command%20line%3F/near/235369633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/set.20builtin.20attr.20values.20at.20command.20line.3F.html#235369633">(Apr 20 2021 at 16:03)</a>:</h4>
<p><code>-Z                     crate-attr=val -- inject the given attribute in the crate</code></p>



<a name="235369664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/set%20builtin%20attr%20values%20at%20command%20line%3F/near/235369664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/set.20builtin.20attr.20values.20at.20command.20line.3F.html#235369664">(Apr 20 2021 at 16:03)</a>:</h4>
<p>I'd guess it should work or if not that's a bug</p>



<a name="235369774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/set%20builtin%20attr%20values%20at%20command%20line%3F/near/235369774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/set.20builtin.20attr.20values.20at.20command.20line.3F.html#235369774">(Apr 20 2021 at 16:04)</a>:</h4>
<p>the help there isn't really clear on the syntax for using it, but maybe it's everything inside [] normally?</p>



<a name="235375956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/set%20builtin%20attr%20values%20at%20command%20line%3F/near/235375956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/set.20builtin.20attr.20values.20at.20command.20line.3F.html#235375956">(Apr 20 2021 at 16:43)</a>:</h4>
<p>let me give that a shot</p>



<a name="235376258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/set%20builtin%20attr%20values%20at%20command%20line%3F/near/235376258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/set.20builtin.20attr.20values.20at.20command.20line.3F.html#235376258">(Apr 20 2021 at 16:45)</a>:</h4>
<p>thanks, that worked</p>



<a name="235376357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/set%20builtin%20attr%20values%20at%20command%20line%3F/near/235376357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/set.20builtin.20attr.20values.20at.20command.20line.3F.html#235376357">(Apr 20 2021 at 16:45)</a>:</h4>
<p>(and yes, the embedded docs for it could be better. I had to try several things before I figured out a combo that worked.)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>